home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / djgpp / include / x11 / xtos.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-11  |  3.1 KB  |  99 lines

  1. /*
  2. * $XConsortium: Xtos.h,v 1.11 91/11/08 17:55:15 gildea Exp $
  3. */
  4.  
  5. /***********************************************************
  6. Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts,
  7. and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
  8.  
  9.                         All Rights Reserved
  10.  
  11. Permission to use, copy, modify, and distribute this software and its
  12. documentation for any purpose and without fee is hereby granted,
  13. provided that the above copyright notice appear in all copies and that
  14. both that copyright notice and this permission notice appear in
  15. supporting documentation, and that the names of Digital or MIT not be
  16. used in advertising or publicity pertaining to distribution of the
  17. software without specific, written prior permission.
  18.  
  19. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  20. ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  21. DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  22. ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  23. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  24. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  25. SOFTWARE.
  26.  
  27. ******************************************************************/
  28.  
  29. #ifndef _Xtos_h
  30. #define _Xtos_h
  31.  
  32. #ifdef INCLUDE_ALLOCA_H
  33. #include <alloca.h>
  34. #endif
  35.  
  36. #ifdef CRAY
  37. #define WORD64
  38. #endif
  39.  
  40. /* stolen from server/include/os.h */
  41. #ifndef NO_ALLOCA
  42. /*
  43.  * os-dependent definition of local allocation and deallocation
  44.  * If you want something other than XtMalloc/XtFree for ALLOCATE/DEALLOCATE
  45.  * LOCAL then you add that in here.
  46.  */
  47. #if defined(__HIGHC__)
  48.  
  49. #include <malloc.h>
  50.  
  51. #if 0 /* use malloc.h instead of below - DMD */
  52. extern char *alloca();
  53.  
  54. #if HCVERSION < 21003
  55. #define ALLOCATE_LOCAL(size)    alloca((int)(size))
  56. pragma on(alloca);
  57. #else /* HCVERSION >= 21003 */
  58. #define    ALLOCATE_LOCAL(size)    _Alloca((int)(size))
  59. #endif /* HCVERSION < 21003 */
  60.  
  61. #define DEALLOCATE_LOCAL(ptr)  /* as nothing */
  62. #endif
  63.  
  64. #endif /* defined(__HIGHC__) */
  65.  
  66.  
  67. #ifdef __GNUC__
  68. #ifndef alloca
  69. #define alloca __builtin_alloca
  70. #endif
  71. #define ALLOCATE_LOCAL(size) alloca((int)(size))
  72. #define DEALLOCATE_LOCAL(ptr)  /* as nothing */
  73. #else /* ! __GNUC__ */
  74. /*
  75.  * warning: mips alloca is unsuitable, do not use.
  76.  */
  77. #if defined(vax) || defined(sun) || defined(apollo) || defined(stellar)
  78. /*
  79.  * Some System V boxes extract alloca.o from /lib/libPW.a; if you
  80.  * decide that you don't want to use alloca, you might want to fix it here.
  81.  */
  82. /* alloca might be a macro taking one arg (hi, Sun!), so give it one. */
  83. #define __Xnullarg        /* as nothing */
  84. char *alloca(__Xnullarg);
  85. #define ALLOCATE_LOCAL(size) alloca((int)(size))
  86. #define DEALLOCATE_LOCAL(ptr)  /* as nothing */
  87. #endif /* who does alloca */
  88. #endif /* __GNUC__ */
  89.  
  90. #endif /* NO_ALLOCA */
  91.  
  92. #ifndef ALLOCATE_LOCAL
  93. #define ALLOCATE_LOCAL(size) XtMalloc((unsigned long)(size))
  94. #define DEALLOCATE_LOCAL(ptr) XtFree((XtPointer)(ptr))
  95. #endif /* ALLOCATE_LOCAL */
  96.  
  97. #endif /* _Xtos_h */
  98. /* DON'T ADD STUFF AFTER THIS #endif */
  99.